<template>
  <div>
    <h1>Home</h1>
    <!-- 路由跳转的第一种写法，字符串写法 -->
    <!-- <router-link to="/home/music">音乐</router-link>
    <router-link to="/home/news">新闻</router-link> -->
    <!-- to的对象写法，通过path设置路由地址 -->
    <!-- <router-link :to="{
        path:'/home/music'
    }">音乐</router-link>
    <router-link :to="{
     path: '/home/news'
      }">新闻</router-link> -->
      <!-- to的对象写法，通过name属性设置路由地址 -->
      <router-link :to="{
        name:'music'
      }">音乐</router-link>
       <router-link :to="{
        name:'news'
      }">新闻</router-link>
    <router-view></router-view>
  </div> 
</template>

<script>
export default {
    name:"Home",
    mounted(){
      console.log('mouted')
    },
    beforeDestroy(){
      console.log('beforeDestroy')
    }
}
</script>

<style>

</style>